package day09_charset_io.com.itheima.d2_byte_stream;

import java.io.FileOutputStream;
import java.io.IOException;

public class Demo4_FileInputStream {
    public static void main(String[] args) throws IOException {
        FileOutputStream os = new FileOutputStream("d:\\demo\\a.txt");
        os.write(97);
        os.write('a');
        os.write('中');
        os.write("\r\n".getBytes());

        byte[] bytes = "中".getBytes("utf-8");
        os.write(bytes);
        os.write("\r\n".getBytes());

        os.write(bytes, 3, 9);
        os.write("\r\n".getBytes());
        os.close();
    }
}
